﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using WoChu.RfClient.Entity;

namespace WoChu.RfClient.Duty
{
    public class OrderCheckUIRule
    {
        private static OrderCheckUIRule _NewInstance = new OrderCheckUIRule();

        public static OrderCheckUIRule NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new OrderCheckUIRule();
                }

                return _NewInstance;
            }
        }

        public List<OrderItemInfo> Query(string OrderNo)
        {
            try
            {
                List<OrderItemInfo> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOrderCheck>.NewInstance.InvokeWebMethod<List<OrderItemInfo>>("Query", new object[] { OrderNo });

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }

        public OutPutParams<bool> InsertPDACheckOrder(string userID, OrderInfo orderInfo)
        {
            OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOrderCheck>.NewInstance.InvokeWebMethod<OrderInfo, OutPutParams<bool>>("InsertPDACheckOrder", new object[] { userID }, orderInfo);

            return _result;
        }

        public OutPutParams<bool> UpdatePDACheckOrder(string userID, OrderInfo orderInfo)
        {
            OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOrderCheck>.NewInstance.InvokeWebMethod<OrderInfo, OutPutParams<bool>>("UpdatePDACheckOrder", new object[] { userID }, orderInfo);

            return _result;
        }

        public OutPutParams<bool> SetCheckOrderItem(string userID, List<OrderItemInfo> lstOrderItem)
        {
            OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOrderCheck>.NewInstance.InvokeWebMethod<List<OrderItemInfo>, OutPutParams<bool>>("SetCheckOrderItem", new object[] { userID }, lstOrderItem);

            return _result;
        }
      
    }
}
